﻿@model PlmPersonLeaveViewModel
@{
    Layout = null;
    ViewBag.Title = "监理人员请假管理-添加";
}
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
<script>
    function UnitCodeChange() {
        var sec = $("#PersonleaveInfo_Pl_Section").val();
        $("#PersonleaveInfo_Pl_PersonName").val("");
        $("#PersonleaveInfo_Pl_CoverMan").val("");
        $("#a_rygl_qjgl_p").attr("href", "/PersonnelLog/PlmPersonLeave/PersonnelList?flag=leave&section=" + sec);
        $("#a_rygl_qjgl_c").attr("href", "/PersonnelLog/PlmPersonLeave/PersonnelList?flag=cover&section=" + sec);
    }
</script>
<script type="text/javascript">
    function dialogRefresh(json) {
        DWZ.ajaxDone(json);
        if (json.statusCode == DWZ.statusCode.ok) {
            $("#pagerForm", navTab.getCurrentPanel()).submit();
            $.pdialog.closeCurrent();
        }
    }
</script>
@{Html.EnableClientValidation();}
@using (Html.BeginForm("PersonLeaveAddData", "PlmPersonLeave", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogRefresh);", @class = "pagerForm required-validate" }))
{
    <div class="pageFormContent sortDrag" layouth="58">
        <table class="tab01 tabNo">
            <tr>
                <td class="td1" style="width: 25%;">申请日期：</td>
                <td>
                    @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_Time, new { Value = DateTime.Now.ToString("yyyy-MM-dd"), @class = "input02 date required", @readonly = "readonly" })
                </td>
            </tr>
            <tr>
                <td class="td1">标段：</td>
                <td>
                    @Html.DropDownListFor(model => model.PersonleaveInfo.Pl_Section, new SelectList(Model.TheUnitList, "UNIT_CODE", "UNIT_CODE"), new { @onchange = "UnitCodeChange()", @class = "input02" })
                </td>
            </tr>
            <tr>
                <td class="td1">请假人：</td>
                <td>
                    <a id="a_rygl_qjgl_p" title="选择人员" class="add" href="/PersonnelLog/PlmPersonLeave/PersonnelList?flag=leave&section=@(Model.TheUnitList.Count > 0 ? Model.TheUnitList[0].UNIT_CODE : "")" mask="true" target="dialog" width="720" height="560" lookupgroup="district">
                        @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_PersonName, new Dictionary<string, object> { { "class", "input02" } })
                        @Html.ValidationMessageFor(model => model.PersonleaveInfo.Pl_PersonName)
                        @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_PersonID, new { @type = "hidden" })
                    </a>
                </td>
            </tr>
            <tr>
                <td class="td1">顶岗人员：</td>
                <td>
                    <a id="a_rygl_qjgl_c" title="选择人员" class="add" href="/PersonnelLog/PlmPersonLeave/PersonnelList?flag=cover&section=@(Model.TheUnitList.Count > 0 ? Model.TheUnitList[0].UNIT_CODE : "")" mask="true" target="dialog" width="720" height="560" lookupgroup="district">
                        @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_CoverMan, new Dictionary<string, object> { { "class", "input02" } })
                        @Html.ValidationMessageFor(model => model.PersonleaveInfo.Pl_CoverMan)
                    </a>
                </td>
            </tr>
            <tr>
                <td class="td1">开始日期：</td>
                <td>
                    @*@Html.TextBoxFor(model => model.PersonleaveInfo.Pl_StartDate, new { @class = "date required input02" })*@
                    @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_StartDate, new { @class = "date input02", @readonly = "readonly", format = "yyyy-MM-dd" })
                    @Html.ValidationMessageFor(model => model.PersonleaveInfo.Pl_StartDate)
                </td>
            </tr>
            <tr>
                <td class="td1">结束日期：</td>
                <td>
                   @* @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_EndDate, new { @class = "date required input02" })*@
                    @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_EndDate, new { @class = "date input02", @readonly = "readonly", format = "yyyy-MM-dd" })
                    @Html.ValidationMessageFor(model => model.PersonleaveInfo.Pl_EndDate)
                </td>
            </tr>
            <tr>
                <td class="td1">请假事由：</td>
                <td>
                    @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_Reason, new Dictionary<string, object> { { "class", "input02" } })
                    @Html.ValidationMessageFor(model => model.PersonleaveInfo.Pl_Reason)
                    @* @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_Reason, new { @size = "95", @class = "required input02" })*@
                </td>
            </tr>
            <tr>
                <td class="td1">备注：</td>
                <td>
                    @Html.TextBoxFor(model => model.PersonleaveInfo.Pl_Remark, new { @size = "95", @class = "input05" })
                </td>
            </tr>
        </table>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <button type="submit" class="btn btn-sm">
                    保存</button>
            </li>
            <li>
                <button type="button" class="close btn btn-default btn-sm">
                    取消</button>
            </li>
        </ul>
    </div>
}
